package oop5;

import oop4.Dog;
import oop4.Penguin;

/**
 * @author oldliu
 * @since 1.0
 */
public class PetDoctor {
    private String name;
    public PetDoctor(String n){
        this.name=n;
    }
    //重复太多了，频繁修改
    public void cure(Dog dog){
        System.out.println(name+"给"+dog.getName()+"看病");
        if(dog.getHealth()>60){
            System.out.println("没病，走两步！");
            return;
        }
        while (dog.getHealth()<95){
            System.out.println("打针吃药，慢慢恢复");
            dog.setHealth(dog.getHealth()+10);
        }
        System.out.println("医生"+name+"把"+dog.getName()+"治好了！");

    }
    public void cure(Penguin dog){
        System.out.println(name+"给"+dog.getName()+"看病");
        if(dog.getHealth()>60){
            System.out.println("没病，走两步！");
            return;
        }
        while (dog.getHealth()<95){
            System.out.println("打针吃药，慢慢恢复");
            dog.setHealth(dog.getHealth()+5);
        }
        System.out.println("医生"+name+"把"+dog.getName()+"治好了！");

    }
    public void cure(Tiger dog){
        System.out.println(name+"给"+dog.getName()+"看病");
        if(dog.getHealth()>60){
            System.out.println("没病，走两步！");
            return;
        }
        while (dog.getHealth()<95){
            System.out.println("打针吃药，慢慢恢复");
            dog.setHealth(dog.getHealth()+5);
        }
        System.out.println("医生"+name+"把"+dog.getName()+"治好了！");

    }
    public void cure(Cat dog){
        System.out.println(name+"给"+dog.getName()+"看病");
        if(dog.getHealth()>60){
            System.out.println("没病，走两步！");
            return;
        }
        while (dog.getHealth()<95){
            System.out.println("打针吃药，慢慢恢复");
            dog.setHealth(dog.getHealth()+5);
        }
        System.out.println("医生"+name+"把"+dog.getName()+"治好了！");

    }
}
